package org.visionlibrary.image.normalization;

import org.visionlibrary.image.model.INormalization;

public class CuttingNormalization extends INormalization {
	int min;

	int max;

	public CuttingNormalization(int min, int max) {
		this.min = min;
		this.max = max;
	}

	public CuttingNormalization() {
		this(0, 255);
	}

	public int normalize(int value) {
		int normalizedValue = value;
		if (value < min)
			normalizedValue = min;
		else if (value > max)
			normalizedValue = max;

		return normalizedValue;
	}

}
